There are a variety of input/output (I/O) interconnect architectures for connecting the various components of a computer system to one another. One popular I/O interconnect architecture is Peripheral Component Interconnect Express (PCI Express), which provides a high-speed interface for interconnecting computer components. Under the PCI Express architecture, one or more switches with built-in flow control are utilized to interconnect the components of a computer system.
Within each switch is a plurality of ports and an internal storage that is shared by the ports of the switch. Each port can be used to connect or link a device to the switch. The device may be a computer component, another switch, a bridge, or something else. A PCI Express link includes one or more lanes, each lane consisting of two differential pairs, in which each pair is unidirectional. Each lane in a link can usually transmit 2.5 gigabytes of data per second (GB/s).
Flow control within a switch is accomplished by assigning the internal storage to each port of the switch in units commonly referred to as credits. Each credit is associated with a location in the internal storage of the switch. The number of credits assigned to each port is typically hardwired within the switch. Hardwiring the internal storage allocation, however, can lead to waste when there are unused credits on one of the ports while another port is consistently utilizing all of its credits and would utilize additional credits if they were made available to the port.
As an example, assume a switch is connected to a 16x PCI Express device (i.e., the link between the device and the switch includes 16 lanes) on port 1 that has a maximum throughput of 40 Gigabytes/second (GB/s), a 4x PCI Express device on port 2 that has a maximum throughput of 10 GB/s, and a 4x PCI Express device on port 3 that also has a maximum throughput of 10 GB/s. Assuming each of the ports 1, 2, and 3 have been assigned 4000 credits, the port 1 device may easily use up all of it credits while the port 2 and port 3 devices are using much less than all of their credits. If, for instance, the devices on ports 2 and 3 are using, on average, 2000 of their respective credits, while the device on port 1 is continuously using all of its 4000 credits, then 4000 unused credits that could be used by the device on port 1 are being wasted in the switch.
Accordingly, there is a need for a way to allocate storage based on usage in switches that utilize flow control. The present invention addresses such a need.